//输入框
/*bootbox.prompt(_msg, function(result) {
    if (result != null) {
		alert(result);
	}
});*/
var bootboxWindow = {
	//bootboxWindow.alert("请选择修改的条目！", null);
	//参数一:提示信息，参数二：关闭窗口执行事件
	alert: function(_msg, _method){
		bootbox.alert({  
            buttons: {  
               ok: {  
                    label: '确定',
                    
                }  
            },  
            message: _msg,  
            callback: function() {  
                //关闭窗口执行事件  
                if(_method != null){
                	_method();
                }
            },  
            title: "提示信息",  
        });  
	},
	//bootboxWindow.confirm("请选择修改的条目！", function(){alert('OK')}, null);
	//参数一:提示信息，参数二：点击确认执行方法，参数三：点击取消执行方法
	confirm: function(_msg, _methodOK, _methodOFF){
		bootbox.confirm({  
	        buttons: {  
	            confirm: {  
	                label: '确认'  
	            },  
	            cancel: {  
	                label: '取消' 
	            }  
	        },  
	        message: _msg,  
	        callback: function(result) {  
	            if(result) {  
	            	if(_methodOK != null){
	                	_methodOK();
	               	}
	            } else {  
	                if(_methodOFF != null){
	                	_methodOFF();
	               	}
	            }  
	        },  
	        title: "提示信息",  
	    });
	},
	
};
/*
 * 提示框事件绑定
 */
;(function ($) {
    $.fn.extend({
    	/*
		'bootboxWindow_alert':function(){
			$('.bootboxWindow_alert').on('click', function(){
				that = $(this);
				var methodName = that.attr('methodName');
				if(typeof methodName == 'undefined' || methodName == null || methodName == ''){
					bootboxWindow.alert('请先选择！',null);
				}else{
					function method(methodName){ 
						this.func = new Function(methodName); 
					} 
					var c = new method(methodName);
					bootboxWindow.alert('请先选择！',c.func);
				}
				try{
					//c.func();
				}catch(e){ 
					//console.log(e);
				}
			});
       	},
       	*/
		'bootboxWindow_confirm':function(){
			$('.bootboxWindow_confirm').on('click', function(){
				that = $(this);
				var methodName = that.attr('methodName');
				if(typeof methodName == 'undefined' || methodName == null || methodName == ''){
					bootboxWindow.confirm(that.attr('msg'),null ,null);
				}else{
					function method(methodName){ 
						this.func = new Function(methodName); 
					} 
					var c = new method(methodName);
					bootboxWindow.confirm(that.attr('msg'), c.func, null);
				}
			});
        }
    });
})(jQuery);
